﻿#ifndef TABLEDEF_TO_LEN_H_
#define TABLEDEF_TO_LEN_H_

#include "SqLiteDB.h"
#include "Db_Cfg_Table_Define.h"


static int GetTableRecordLen(unsigned int AppType, unsigned int TableID)		//获取表记录长度
{
	switch(AppType)
	{
	case SYSTEM_TYPE_NSA_CD:
		{
			switch(TableID)
			{
			case TABLE_CTABLE_INFO:
				return sizeof(cTable_Info);
				break;
			case TABLE_CCOLUMN_INFO:
				return sizeof(cColumn_Info);
				break;
			case TABLE_CMENU_INFO:
				return sizeof(cMenu_Info);
				break;
			case TABLE_CPTLCOLUMN_INFO:
				return sizeof(cColumn_Info);
				break;
			default:
				return 0;
				break;
			}
		}
		break;
		case SYSTEM_TYPE_NSA_YD:
			{
				switch(TableID)
				{
				case TABLE_RTASK_INFO:
					return sizeof(rTask_Info);
					break;
				case TABLE_RDEVS_INFO:
					return sizeof(rDevS_Info);
					break;
				case TABLE_RDEVS_YX:
					return sizeof(rDevS_Yx);
					break;
				case TABLE_RDEVS_YC:
					return sizeof(rDevS_Yc);
					break;
				case TABLE_RDEVS_YM:
					return sizeof(rDevS_Ym);
					break;
				case TABLE_RDEVS_YK:
					return sizeof(rDevS_Yk);
					break;
				case TABLE_RDEVS_BHYC:
					return sizeof(rDevS_BhYc);
					break;
				case TABLE_RDEVS_SETS:
					return sizeof(rDevS_SetS);
					break;
				case TABLE_RDEVS_PARAM:
					return sizeof(rDevS_Param);
					break;
				case TABLE_RDEVS_JDXSS:
					return sizeof(rDevS_JDXSS);
					break;
				case TABLE_RDEVS_RYB:
					return sizeof(rDevS_Ryb);
					break;
				case TABLE_RDEVS_SETAREA:
					return sizeof(rDevS_SetArea);
					break;
				case TABLE_RDEVS_OUT:
					return sizeof(rDevS_Out);
					break;
// 				case TABLE_RDEVS_COMMU:
// 					return sizeof(rDevS_Commu);
// 					break;
				case TABLE_RTASK_PARA_INFO:
					return sizeof(rTask_Para_Info);
					break;
				case TABLE_REXPDEFINE_INFO:
					return sizeof(rExpDefine_Info);
					break;
				case TABLE_REXPVARIABLE_LIST:
					return sizeof(rExpVariable_List);
					break;
				case TABLE_RDEVMODEL_INFO:
					return sizeof(rDevModel_Info);
					break;
				case TABLE_RDEVMODEL_YX:
					return sizeof(rDevModel_Yx);
					break;
				case TABLE_RDEVMODEL_YC:
					return sizeof(rDevModel_Yc);
					break;
				case TABLE_RDEVMODEL_YM:
					return sizeof(rDevModel_Ym);
					break;
				case TABLE_RDEVMODEL_YK:
					return sizeof(rDevModel_Yk);
					break;
				case TABLE_RDEVMODEL_BHYC:
					return sizeof(rDevModel_Bhyc);
					break;
				case TABLE_RDEVMODEL_SET:
					return sizeof(rDevModel_Set);
					break;
				case TABLE_RDEVMODEL_PARA:
					return sizeof(rDevModel_Para);
					break;
				case TABLE_RDEVMODEL_PREC:
					return sizeof(rDevModel_Prec);
					break;
				case TABLE_RDEVMODEL_RYB:
					return sizeof(rDevModel_Ryb);
					break;
				case TABLE_RDEVMODEL_SETAREA:
					return sizeof(rDevModel_SetArea);
					break;
					
				case TABLE_RPARAMS_SYS:
					return sizeof(rParamS_Sys);
					break;  
// 				case TABLE_RPARAMS_COMMU:
// 					return sizeof(rParamS_Commu);
// 					break;
// 				case TABLE_RPARAMS_DEV:
// 					return sizeof(rParamS_Dev);
// 					break;  
// 				case TABLE_RPARAMS_SET:
// 					return sizeof(rParamS_Set);
// 					break;  
// 				case TABLE_RPARAMS_RYB:
// 					return sizeof(rParamS_Ryb);
// 					break;  
				case TABLE_RPARAMS_NET:
					return sizeof(rParamS_Net);
					break;  
// 				case TABLE_RPARAMS_JDXS:
// 					return sizeof(rParamS_JDXS);
// 					break;  
				case TABLE_RPARAMS_VERS:
					return sizeof(rParamS_Vers);
					break;  
// 				case TABLE_RPARAMS_YX:
// 					return sizeof(rParamS_Yx);
// 					break;  
// 				case TABLE_RPARAMS_YC:
// 					return sizeof(rParamS_Yc);
// 					break;  
// 				case TABLE_RPARAMS_YM:
// 					return sizeof(rParamS_Ym);
// 					break;  	
// 				case TABLE_RPARAMS_YK:
// 					return sizeof(rParamS_Yk);
// 					break;  
// 				case TABLE_RPARAMS_BHYC:
// 					return sizeof(rParamS_BhYc);
// 					break;
// 				case TABLE_RPARAMS_OUT:
// 					return sizeof(rParamS_Out);
// 					break;
				case TABLE_RPARAMS_UART:
					return sizeof(rParamS_Uart);
					break;
// 				case TABLE_RPARAMS_SETAREA:
// 					return sizeof(rParamS_SetArea);
// 					break;

				case TABLE_RTRANSMITCONFIG_INFO:
					return sizeof(rTransmitConfig_Info);
					break;
				case TABLE_RTRANSMIT_YX:
					return sizeof(rTransmit_Yx);
					break;
				case TABLE_RTRANSMIT_YC:
					return sizeof(rTransmit_Yc);
					break;
				case TABLE_RTRANSMIT_YK:
					return sizeof(rTransmit_Yk);
					break;
				case TABLE_RTRANSMIT_YM:
					return sizeof(rTransmit_Ym);
					break;
				case TABLE_RLOGIC_DEVICE: //17.5.8添加 逻辑设备
					return sizeof(rLogic_Device);
					break;
				case TABLE_RLOGIC_NODE: //17.5.8添加 逻辑节点
					return sizeof(rLogic_Node);
					break;
				case TABLE_RDATA_OBJECT://17.5.8添加 数据对象
					return sizeof(rData_Object);
					break;
				default:
					return 0;
					break;
				}
			}
			break;
	default:
		return 0;
		break;
	}
	return 0;
};

#endif 